home *** CD-ROM | disk | FTP | other *** search
- Path: csun.edu!kc44097
- From: kc44097@csun.edu (chen)
- Newsgroups: comp.lang.c
- Subject: A weird thing about printf()
- Date: 10 Apr 1996 06:52:18 GMT
- Organization: California State University, Northridge
- Message-ID: <4kflr2$5if@dewey.csun.edu>
- NNTP-Posting-Host: louie.csun.edu
- X-Newsreader: TIN [version 1.2 PL2]
-
-
-
- The program :
-
- #include <stdio.h>
-
- int answer;
- main()
- {
- answer=2+2;
- printf("The answer is %d\n");
- return 0;
- }
-
- In printf(),I lost "answer" in the end,but it works,and give me the
- result 0.I wonder how the compiler handle this condition.Also,is this
- allow by C?(by this, I mean is this a leagal usage in language itself,
- or just a mistake cause by the compiler?)
-
- Can someone give me some advice ? Please e-mail me :
- kc44097@huey.csun.edu
-
- Thankx !!!!!!
-